const { resolve } = require('path')

const mongoose = require(resolve(__dirname, '../db'))

const AboutSchema = mongoose.model('about', new mongoose.Schema({
  title: {  // 关于信息标题
    type: String,
    required: [true, '关于信息标题不可为空!'],
    trim: true
  },
  content: {  // 描述
    type: String,
    min: [1, '描述最少一个字符!'],
    max: [800, '描述最多800字!'],
    trim: true
  },
  isDel: {
    type: Boolean,
    default: false
  }
}))

module.exports = AboutSchema